package net.qiqb.usr.customer.application;

import lombok.Getter;
import net.qiqb.usr.custom.client.types.CustomerId;
import net.qiqb.usr.customer.domain.Customer;
import net.qiqb.usr.customer.infrastructure.TestService;
import net.qiqb.usr.customer.infrastructure.persistence.CustomLoader;
import net.qiqbframework.commandhandling.gateway.CommandGateway;
import net.qiqbframework.messaging.task.CurrentMessageTask;
import net.qiqbframework.modelling.command.BizHandler;
import net.qiqbframework.modelling.command.BizIdentifierVoucher;
import net.qiqbframework.modelling.command.Cmd;

@Getter
//@Cmd(Customer.class)
public class ChangeCustomNameCmd {

    @BizIdentifierVoucher
    private final CustomerId id;


    private final String name;

    public ChangeCustomNameCmd(CustomerId id, String name) {
        this.id = id;
        this.name = name;
    }




    //@BizHandler
    public void handle(Customer customer, TestService testService) {
        final Object resource = CurrentMessageTask.get().getResource("_test");
        customer.changeName(this);

        //testService.test(id);
    }
}
